import React, { useState, useEffect } from 'react';
import { useMount } from 'ahooks';
import * as echarts from 'echarts';
export interface ITestProps {
}

function Test (props: ITestProps) {
  useEffect(() => {
    var myChart = echarts.init(document.getElementById('box'))
    setTimeout(() => {
      const res = [100, 200, 300, 400 ,500]
      myChart.setOption({
        title: {
            text: 'ECharts 入门示例'
        },
        tooltip: {
          trigger: 'axis'
      },
        xAxis: {
            data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: [{
            name: '销量',
            type: 'line',
            data: res
        }]
    });
    }, 3000)


  }, [])
  return (
    <div>
      <div id="box" style={{ width: 600, height: 400, backgroundColor: '#fff'}}></div>
    </div>
  );
}
export  default Test
